package com.csx.saas.platform.init.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.csx.basic.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 行业
 * </p>
 *
 * @author ChenSongXin
 * @since 2021-03-03
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("saas_init_industry")
@ApiModel(value = "InitIndustry", description = "行业")
@AllArgsConstructor
public class InitIndustry extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 行业名称
     */
    @ApiModelProperty(value = "行业名称")
    @Length(max = 20, message = "行业名称长度不能超过20")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "行业名称")
    private String name;


    @Builder
    public InitIndustry(Long id, LocalDateTime createTime, Long createdBy, LocalDateTime updateTime, Long updatedBy, 
                    String name) {
        this.id = id;
        this.createTime = createTime;
        this.createdBy = createdBy;
        this.updateTime = updateTime;
        this.updatedBy = updatedBy;
        this.name = name;
    }

}
